import {
  Table,
  Model,
  Column,
  DataType,
  PrimaryKey,
  AutoIncrement,
  Unique,
  AllowNull,
  Comment,
} from 'sequelize-typescript';

@Table({
  comment: '公告表',
  tableName: 'announcement',
})
export class Announcement extends Model {
  @PrimaryKey
  @AutoIncrement
  @Unique
  @AllowNull(false)
  @Comment('公告id')
  @Column(DataType.BIGINT)
  id: number;

  @AllowNull(false)
  @Comment('公告标题')
  @Column(DataType.STRING(255))
  title: string;

  @AllowNull(false)
  @Comment('公告内容')
  @Column(DataType.TEXT)
  content: string;

  @AllowNull(false)
  @Comment('创建者名称')
  @Column(DataType.STRING(100))
  creatorName: string;
}
